﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text;
using Abp.AutoMapper;
using FwProject.ShoppingMall.Com;

namespace FwProject.Com.Dto
{
    /// <summary>
    /// 广告明细
    /// </summary>
    [AutoMap(typeof(ShopAd))]
    public class ShopAdInput
    {
        /// <summary>
        /// 广告名称
        /// </summary>
        [Required(ErrorMessage = "{0}不能为空")]
        [Display(Name ="广告名称")]
        public string AdName { get; set; }

        /// <summary>
        /// 图片logo
        /// </summary>
        [Required(ErrorMessage = "{0}不能为空")]
        [Display(Name = "图片logo")]
        public string PicLogo { get; set; }

        /// <summary>
        /// 图片打开的网页路径
        /// </summary>
        [Required(ErrorMessage ="{0}不能为空")]
        [Display(Name = "广告链接")]
        public string HttpUrl { get; set; }

        /// <summary>
        /// 是否激活（实现IPassivable接口）
        /// </summary>
        [Display(Name = "是否激活")]
        public bool IsActive { get; set; } = true;

        /// <summary>
        /// 广告详细内容
        /// </summary>
        [Display(Name = "广告详细内容")]
        public string ContentDetails { get; set; }

        /// <summary>
        /// 广告类型
        /// </summary>
        [Display(Name = "广告类型")]
        public AdType AdType { get; set; } = AdType.网页;

        /// <summary>
        /// json来源
        /// </summary>
        [Display(Name = "json来源")]
        public string JsonSource { get; set; }

        /// <summary>
        /// 广告开始时间
        /// </summary>
        [Display(Name = "广告开始时间")]
        public DateTime AdbeginTime { get; set; }

        /// <summary>
        /// 广告结束时间
        /// </summary>
        [Display(Name = "广告结束时间")]
        public DateTime AdEndTime { get; set; }

        /// <summary>
        /// 收取费用
        /// </summary>
        [Display(Name = "收取费用")]
        public decimal Charge { get; set; } = 0m;

        /// <summary>
        /// 广告显示的位置
        /// </summary>
        [Display(Name = "广告位置")]
        public Guid AdFlag { get; set; }

        internal object MapTo<T>(ShopAdInput input)
        {
            throw new NotImplementedException();
        }
    }
}
